package com.sctvcloud.bazhong.ui.adapter.holder;

import android.content.Context;
import android.text.TextUtils;
import android.view.View;

import com.ruihang.generalibrary.ui.adapter.holder.BaseRecylerHolder;
import com.ruihang.generalibrary.ui.widget.CustomFontTextView;
import com.sctvcloud.bazhong.R;
import com.sctvcloud.bazhong.beans.SearchKeyWords;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by Administrator on 2017/9/10 0010.
 */

public class SearchHotHolder extends BaseRecylerHolder<SearchKeyWords> implements View.OnClickListener {
    @BindView(R.id.search_item_order_name)
    protected CustomFontTextView hotWords;

    public SearchHotHolder(Context context, View itemView) {
        super(context, itemView);
        itemView.setOnClickListener(this);
    }

    protected void initInject() {
        ButterKnife.bind(this, itemView);
    }

    @Override
    public void setData(SearchKeyWords searchKeyWords) {
        hotWords.setText(TextUtils.isEmpty(searchKeyWords.getKeywords()) ? "" : searchKeyWords.getKeywords());
    }

    @Override
    public void onClick(View v) {
        if (internalClick != null) {
            internalClick.onItemInternalClick(itemView, v, getAdapterPosition());
        }
    }
}
